import store from '@/store'

/**
 * @param {Array} value
 * @returns {Boolean}  v-permission=""
 * @example see @/views/permission/directive.vue
 */
export default function checkPermission(value) {
  const menuList = store.getters && store.getters.menus
  const hasPermission = menuList.some(menu => {
    return menu.permission == value
  })
  return hasPermission
}
